package bb.lanxing.calc.calculator;

import bb.lanxing.calc.data.IndoorbikePoint;
import android.util.Log;


public class IndoorbikeCalc {
    final static private String TAG = "IndoorbikeCalc";
    private IndoorbikePoint lastIndoorbikePoint;

    public void calc(IndoorbikePoint indoorbikePoint) {
        if (this.lastIndoorbikePoint == null) {
            this.lastIndoorbikePoint = indoorbikePoint;
            return;
        }

        double indoorbikespeed = indoorbikePoint.getIndoorbikeSpeed();
        indoorbikePoint.setIndoorbikeSpeed(indoorbikespeed);

        int indoorbikecadence = indoorbikePoint.getIndoorbikeCadence();
        indoorbikePoint.setIndoorbikeCadence(indoorbikecadence);

        int indoorbikepower = indoorbikePoint.getIndoorbikePower();
        indoorbikePoint.setIndoorbikePower(indoorbikepower);

        this.lastIndoorbikePoint = indoorbikePoint;
    }

    public void release() {
        this.lastIndoorbikePoint = null;
    }
}
